package com.hist.test;

import com.hist.dao.UserMapper;
import com.hist.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @auther Ren Gaoshuai
 * @date 2021-04-07 19:52
 **/
public class MybatisTest3 {

    @Test
    public void test1(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserMapper userMapperImpl2 = context.getBean("userMapperImpl2", UserMapper.class);

        List<User> userList = userMapperImpl2.queryUser();

        for (User user : userList) {
            System.out.println(user);
        }

    }
}
